1. Technical Field
This invention relates to a two-dimensional code publishing program and a two-dimensional code decoding program for decoding a bit string expressed as a two-dimensional code displayed on a display of an image display device or output on a sheet-like media or a surface of a solid object by a image forming device. Image of the two-dimensional code is captured by an image-capturing device, and the obtained image data is analyzed using a computer to decode the bit string.
2. Related Arts
A two-dimensional code is generally composed of a plurality of cells arranged in a lattice pattern and positioning symbols disposed around the cells, and expresses a bit string on a flat surface. A bit string is normally the smallest unit of information a computer can handle, and consists of a sequence of binary digits 0 and 1 in a binary string.
The cells are envisioned on a white flat surface, for example, and are composed of two types of cells: 1) marked cells with a black data mark and 2) white blank cells without a data mark. Thus, a bit string can be expressed by a formation of a layout pattern by displays of the two types of cells. For example, a bit string of 0's and 1's is expressed by substituting each 1 with a marked cell and each 0 with a blank cell.
For a two-dimensional code represented in such a way, the bit string can be decoded by obtaining an image data of the two-dimensional code using an image-capturing device and analyzing the obtained image data. A computer is used for analyzing, and the positions of the cells in the image data are calculated to determine the display of the cells by the calculated positions. As a result, the bit string represented as the two-dimensional code can be decoded based on the determined display of cells.
In doing so, the positions of the cells are calculated based on positioning symbols or positioning marks denoted at given fixed locations. For example, a method for calculating the position of each cell based on the size and orientation of the two-dimensional code in the image data which are obtained from the distance and the angle between more than two detected positioning symbols/marks is known.
There is also known a method to determine the display of cells by the gradation value (or density) at the approximate center of a cell. In this method, the gradation of the center pixel of a cell is compared to a preset threshold value, and cells with a higher gradation (higher density) than the threshold value is considered to be a marked cell and cells with a lower gradation (lower density) is considered to be a blank cell.
The threshold value can be calculated based on the gradation of a reference image displayed in a predetermined area (patent document 1). By using this method, it is possible to improve the accuracy of determination as the reliability of the threshold value rises.
In recent years, as a further development to conventional two-dimensional codes, colored two-dimensional codes that display the cells with multiple colors are suggested (patent document 1). By displaying cells using multiple types of colors, it is possible to denote bit strings with higher density compared to monochrome two-dimensional codes composed of only two colors, black and white.
In two-dimensional codes, bit strings can be denoted with higher density compared to conventional bar codes. In other words, bit strings having a desired volume can be represented on a limited display area. Due to such a feature, two-dimensional codes have been utilized in various ways in recent years.
For example, two-dimensional codes represent digital information such as textual information, image information, audio information, cryptographic information and computer command codes on an image display device, and are read by an image-capturing device. Furthermore, it is used to record such digital information onto sheet-like media such as paper or surfaces of solid objects such as an electronic component.
As a method to utilize two-dimensional codes effectively, a technique to express bit strings prepared in correspondence to record numbers in a database is disclosed (patent literature 2). In this case, targeted digital information are not embedded in two-dimensional codes, but are associated with bit strings and are stored and managed on the network via a server. Therefore, the amount of information that can be handled is not limited by the display area of two-dimensional codes. It becomes possible to target large volume information including video information and such, in addition to the aforementioned types of digital information.
There is also disclosed a method to perform a predetermined conversion to bit strings expressed as two-dimensional codes (patent literature 2). For example, performing encoding process can prevent illegitimate access by a third person. Also, using error-correcting codes prevents read errors that are caused by determination errors of the display of cells.    Patent Document 1: U.S. Patent Application Publication No. 2007/0051813 A1    Patent Document 2: U.S. Patent Application Publication No. 2006/0282500 A1
Due to such technical advancements as increase in computer processing speed and storage medium memory capacity, larger volume of digital data can now be handled. Also, with the advancement in communication technologies, network environment is being established allowing for easy sending and receiving of such digital data. Increase in communication speed and penetration rate of wireless communication using portable devices is especially apparent. Users can now exchange information in various scenes, free from time and geographical constraints.
Due to the above background, two-dimensional codes are used by many users for various objectives, and are seen in various scenes. Now, two-dimensional codes are no longer just input/output means of information, but are symbolic representations of digital information. Therefore, they are expected to have homogeneous and beautiful design without incongruities. At the same time, bit strings are required to be denoted with high density and be decoded in various situations.
Overall, there is a need to be able to handle digital information that surrounds us in a simpler and more comfortable way.
In a two-dimensional code where each cell is represented in color, a larger number of bits can be expressed in a unit area. On the other hand, because each cell of the two-dimensional code is displayed brightly, users have high expectations for the design and beautiful display of the two-dimensional code.
When the cells are colored in white or yellow, for example, and do not stand out against the background surrounding the two-dimensional code, it may appear as if the marks on the cells are missing. In such a case, incongruity occurs since those cells do not look homogeneous with cells represented in other colors. This is especially apparent when lightly colored cells are placed at the border between the two-dimensional code and the surrounding area (edge cells).
When the cells are colored in black, for example, and stand out too strongly against the background surrounding the two-dimensional code, incongruity may also occur since the marks on those cells appear emphasized and not homogeneous with other cells.
With colored cells, while the variation of display increases, determination errors are more likely to occur than with monochrome cells where the only factor to determine is the presence or absence of a mark. There are several causes for determination error to occur. For example, when the display of cells consists of a combination of plural color ingredients, each of the color ingredients within the image data obtained at the decoding of the two-dimensional code may vary in color by influence from other color ingredients.
The two-dimensional code within the image data obtained at the decoding of the two-dimensional code may be disarrayed due to input or output conditions. Decoding errors are more likely to occur in such a case. Possible causes of image disarray that occur when the two-dimensional code is being output may be misalignment of output position or output density or curving of the display surface by the output device. Examples of causes of image disarray that occur when the two-dimensional code is being input may include optical distortion of the input device, misalignment of input gradation, slanting of the capturing angle and the input device being out of focus.